import { GetAllProvinceLists, resAllHospitalListResult, ResHospitalDetailData } from './model/hospitalListType';
//导入请求文件
import { request } from "@/utils/http";
import { reqHospitallistParams } from "./model/hospitalListType";

//导出请求方法
//请求所有医院列表数据接口函数
export const getHospitalListData = ({ page, limit, ...values }: reqHospitallistParams) => {
    return request.get<any, resAllHospitalListResult>(`/admin/hosp/hospital/${page}/${limit}`, {
        //请求字符串
        params: values
        //请求头...
    });
}

//请求所有省份数据接口函数
export const getAllProvinceList = () => {
    return request.get<any, GetAllProvinceLists>('/admin/cmn/dict/findByDictCode/province');
}

//请求对应省份下的城市的接口函数
export const getProvinceCityData = (parentId: number) => {
    return request.get<any, GetAllProvinceLists>(`/admin/cmn/dict/findByParentId/${parentId}`);
}

//请求对应城市下的区的接口函数
export const getdictCodeData = (parentId: number) => {
    return request.get<any, GetAllProvinceLists>(`/admin/cmn/dict/findByParentId/${parentId}`);
}

//请求所有的医院类型的接口函数
export const getAllHospitalType = () => {
    return request.get<any, GetAllProvinceLists>('/admin/cmn/dict/findByParentId/10000');
}

//请求修改医院状态的接口函数
export const ModifyHospitalStatus = (id: string, status: number) => {
    return request.get<any, null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`);
}

//请求单条医院详情的接口函数
export const getOneHospitalDetailData = (id: string) => {
    return request.get<any, ResHospitalDetailData>(`/admin/hosp/hospital/show/${id}`);
}